<!DOCTYPE HTML>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="csrf-token" content="{{ csrf_token() }}">
    <link rel="stylesheet" href="/css_system/common.css"/>
    <link rel="stylesheet" href="/css_system/main.css"/>
    <link href="/js_system/jQueryUI/jquery-ui.css" rel="stylesheet">
    <!-- 对话框 -->
    <link rel="stylesheet" href="/js_system/easydialog/easydialog.css"/>
    <script type="text/javascript" src="/js_system/easydialog/easydialog.js"></script>
    <script type="text/javascript" src="/js_system/cueeasy.js"></script>
    <script type="text/javascript" src="/js_system/jquery.min.js"></script>
    <!-- 上传图片 -->
    <script type="text/javascript" src="/uploadify/jquery.uploadify.js"></script>
    <link rel="stylesheet" type="text/css" href="/uploadify/uploadify.css">
    <script type="text/javascript" src="/js_system/readingparty.js"></script>
</head>
<body>
<div class="container">
    <div class="location clearfix">
        <div class="here_area fl"><strong>当前位置：</strong>APP管理&nbsp;&nbsp;&raquo;&nbsp;&nbsp;修改读书会信息</div>
        <div class="here_btn fr">
            <a href="javascript:history.back()" class="btn btn_back">返回</a>
            <a href="javascript:;" onclick="location.replace(location.href);" class="btn btn_refresh">刷新</a>
        </div>
    </div>


    <form action="/admin_system/readingparty/readpartyEdit" method="post">
        <div id="tabs-1">
            @include('common.alert-url')
            <input type="hidden" name="_token" value="<?php echo csrf_token(); ?>">
            <input type="hidden" name="readpartyId" value="{{$entReadingParty->ReaParID}}">
            <table class="dataTable">
                <tr>
                    <td class="ltd">读书会状态</td>
                    <td class="rtd">
                        <select style="width:200px;" class="select"  name="states" required>
                            @foreach($arrayStates as $key=>$val)
                                @if($key==$entReadingParty->States)
                                    <option selected="selected" value="{{$key}}">&nbsp;&nbsp;{{$val}}</option>
                                @else
                                    <option value="{{$key}}">&nbsp;&nbsp;{{$val}}</option>
                                @endif
                            @endforeach
                        </select>
                    </td>
                </tr>

                <tr>
                    <td class="ltd">读书会类型</td>
                    <td class="rtd">
                        <select style="width:200px;" class="select" name="readpartyType" required>
                            @foreach($arrayReaParType as $k=>$v)
                                @if($v!='')
                                    @if($k==$entReadingParty->ReaParType)
                                        <option selected="selected" value="{{$k}}">&nbsp;&nbsp;{{$v}}</option>
                                    @else
                                        <option value="{{$k}}">&nbsp;&nbsp;{{$v}}</option>
                                    @endif
                                @endif
                            @endforeach
                        </select>
                    </td>
                </tr>


                <tr>
                    <td class="ltd">公司名称</td>
                    <td class="rtd">
                        @if($entReadingParty->CompanyName)
                            <input  value="{{$entReadingParty->CompanyName}}" class="input-text" type="text" name="companyName" readonly />
                        @else
                            <input  value="{{$entReadingParty->CompanyName}}" class="input-text" type="text" name="companyName"/>
                        @endif
                        
                    </td>
                </tr>

                <tr>
                    <td class="ltd">管理员</td>
                    <td class="rtd">

                        <input value="{{$entReadingParty->manager}}" class="input-text" name="manager" id="manager"/>
                        <input type="hidden" id="managerId" name="managerId">
                    </td>
                </tr>

                <tr>
                    <td class="ltd">读书会名称</td>
                    <td class="rtd">
                        <input value="{{$entReadingParty->ReaParName}}" class="input-text" name="ReaParName"/>
                    </td>
                </tr>
                <tr>
                    <td class="ltd">读书会规则</td>
                    <td class="rtd"><textarea style="width: 500px;" class="textarea"  name="regulation">{{$entReadingParty->Regulation}}</textarea></td>
                </tr>

                <tr>
                    <td class="ltd">头像</td>
                    <td class="rtd">
                        <div class="PreviewImg">
                            <div id="PreviewImgs" style="padding:0px; background:#fff url(/images_system/yulan.gif) no-repeat center;" class="PreviewTD delfile_1">
                                @if($entReadingParty->FilePath1!='')
                                    <a target="_blank" href="{{$entReadingParty->FilePath1}}"><img src="{{$entReadingParty->FilePath1}}"></a>
                                @endif
                            </div>
                        </div>
                        <input type="hidden" id="File_1" value="{{$entReadingParty->FilePath1}}" name="File_1">
                        <input id="file_upload" name="file_upload" type="file">
                        @if($entReadingParty->FilePath1=='')
                            <a id="addvideoFile_1" style="font-weight:normal;color:#FFF; "
                               class="button button-primary"
                               href="javascript:$('#file_upload').uploadify('upload','*');">上传</a>
                            <a id="delvideoFile_1" style="font-weight:normal;color:#FFF; display: none;"
                               onclick="delFile(1);" class="button button-primary"
                               href="javascript:void(0);">删除</a>
                        @else
                            <a id="addvideoFile_1" style="font-weight:normal;color:#FFF; display: none;"
                               class="button button-primary"
                               href="javascript:$('#file_upload').uploadify('upload','*');">上传</a>
                            <a id="delvideoFile_1" style="font-weight:normal;color:#FFF; " onclick="delFile(1);"
                               class="button button-primary"
                               href="javascript:void(0);">删除</a>
                        @endif


                        <script type="text/javascript">
                            <?php $timestamp = time();?>
                            $(function () {
                                $('#file_upload').uploadify({
                                    'buttonText': "请选择文件",
                                    'fileTypeExts': '*.jpg;*.gif;*.png;*.jpeg',
                                    'auto': false,
                                    'formData': {
                                        'timestamp': '<?php echo $timestamp;?>',
                                        'token': '<?php echo md5('unique_salt' . $timestamp);?>'
                                    },
                                    'swf': '/uploadify/uploadify.swf',
                                    'uploader': '/uploadify/uploadify.php',
                                    'onUploadSuccess': function (file, data, response) {
                                        if (data != '') {
                                            $('#File_1').val(data);
                                            $('#addvideoFile_1').hide();
                                            $('#delvideoFile_1').show();
                                            $('#PreviewImgs').html('<a target="_blank" href=' + data + '><img src=' + data + '></a>');
                                        }
                                    }
                                });
                            });
                        </script>

                    </td>
                </tr>
            </table>
        </div>

        <div class="contBtn">
            <table class="dataTable">
                <tfoot>
                <tr>
                    <td class="ltd"></td>
                    <td class="rtd">
                        <input id="btnEditFrom" type="submit" class="btn btn_save" value="保存">
                    </td>
                </tr>
                </tfoot>
            </table>
        </div>
    </form>
</div>
@include('admin_system/layout/include_members',['idInput'=>'cloUserId','nameInput'=>'cloName'])
<script src="/js_system/jQueryUI/jquery-ui.js"></script>
<script src="/js_system/jqueryui.js"></script>
</body>
</html>

